package com.baitiaojun.api.vo;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * @类名 PageInfo
 * @描述 TODO
 * @作者 白条君
 * @创建日期 2022/11/2 23:58
 * @版本 1.0
 */
@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
public class PageInfo {

    private long size;
    private Object pageList;

    public static PageInfo.PageInfoBuilder builder() {
        return new PageInfoBuilder<>();
    }

    public static class PageInfoBuilder<T> {

        private long size;
        private T pageList;

        public PageInfoBuilder size(long size) {
            this.size = size;
            return this;
        }

        public PageInfoBuilder pageList(T pageList) {
            this.pageList = pageList;
            return this;
        }

        public PageInfo build() {
            return new PageInfo(size, pageList);
        }
    }
}